Skip to content

Fixes crash when calling twice HWCDC::end() #8332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

SuGlider
Copy link
Collaborator

Description of Change

JTAG/CDC Serial interface crashes when Serial.end() is called twice.
This PR shall be applied to Arduino Core 2.0.10 and 3.0.0.

Tests scenarios

Tested with ESP32-C3 and ESP32-S3.

// MUST USE USB Mode "CDC/JTAG" and "CDC on Boot: Enabled"
void setup() {
  // No need to initialize the RGB LED
  Serial.begin();
  delay(500);
  Serial.println("First Print Testing");
  Serial.flush();
  
  Serial.end();
  Serial.end();  // Second end() causes crash.

  Serial.begin();
  log_d("LOG printing after end-begin");
  Serial.println("Second Print Testing");
  Serial.flush();
}

void loop() {
}

Related links

Fix #8326

@SuGlider SuGlider added Type: Bug 🐛 All bugs Chip: ESP32-C3 Issue is related to support of ESP32-C3 Chip Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip Area: Peripherals API Relates to peripheral's APIs. labels Jun 19, 2023
@SuGlider SuGlider added this to the 2.0.10 milestone Jun 19, 2023
@SuGlider SuGlider self-assigned this Jun 19, 2023
@me-no-dev me-no-dev merged commit 18164e6 into espressif:master Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Peripherals API Relates to peripheral's APIs. Chip: ESP32-C3 Issue is related to support of ESP32-C3 Chip Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip Type: Bug 🐛 All bugs
Projects
Development

Successfully merging this pull request may close these issues.

Serial USB CDC JTAG S3 crashes when end() is called twice
2 participants